package java_DesignPattern.SixPrinciple.DependencyInversionPrinciple.Default;

/**
 * 电脑类
 */
public class Computer {

    //电脑组件
    private IntelCPU cpu;
    private KingstonMemory memory;
    private XJieHardDisk hardDisk;

    public void setCpu(IntelCPU cpu) {
        this.cpu = cpu;
    }

    public void setMemory(KingstonMemory memory) {
        this.memory = memory;
    }

    public void setHardDisk(XJieHardDisk hardDisk) {
        this.hardDisk = hardDisk;
    }

    public void run(){
        cpu.run();
        memory.read("数据");
        hardDisk.read("数据");
    }
}
